package com.tbit.main.service.impl;

import com.tbit.main.dao.ter.TerPositionDao;
import com.tbit.main.pojo.TerLastPos;
import com.tbit.main.service.TerPositionService;
import com.tbit.main.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("terPositionService")
public class TerPositionServiceImpl implements TerPositionService {
    @Autowired
    private TerPositionDao terPositionDao;

    @Override
    public List<TerLastPos> getByMachineNOBatch(List<String> machineNOs) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineNOs", StringUtil.getArrayListString(machineNOs));

        return terPositionDao.getByMachineNOBatch(params);
    }

    @Override
    public List<TerLastPos> getAll() {
        return terPositionDao.getAll();
    }

    @Override
    public TerLastPos getByMachineNO(String machineNO) {
        return terPositionDao.getByMachineNO(machineNO);
    }

}  